home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 55375 / 55375.xpi / chrome / chromeFiles / content / btSidebar.xul < prev    next >
Extensible Markup Language  |  2009-11-15  |  2KB  |  45 lines

  1. <?xml version="1.0"?>
  2. <!DOCTYPE btClient SYSTEM "../locale/btClient.dtd">
  3. <window
  4.         onload="openSidebar();"
  5.         onunload="closeSidebar();"
  6.         xmlns:html="http://www.w3.org/1999/xhtml"
  7.         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  8.   <script type="application/x-javascript;version=1.7">
  9. <![CDATA[
  10.     function openSidebar() {
  11.       var observerService = Components.classes["@mozilla.org/observer-service;1"]
  12.                                       .getService(Components.interfaces.nsIObserverService)
  13.  
  14.       sidebarBox = window.top.document.getElementById("sidebar-box");
  15.       var sidebarid = sidebarBox.getAttribute("sidebarcommand");
  16.       var broadcaster = window.top.document.getElementById(sidebarid);
  17.       if (broadcaster.hasAttribute("btBoomBundle")) {
  18.         var btBoomBundle = window.top.document.getElementById(broadcaster.getAttribute('btBoomBundle'));
  19.       }
  20.       if (broadcaster.hasAttribute("brand")) {
  21.         var brandObject = window.top.BrandThunder.clients[broadcaster.getAttribute('brand')];
  22.       }
  23.  
  24.       var url = btBoomBundle.getString(sidebarid + ".url");
  25.       if (sidebarBox.hasAttribute("btSidebarParams")) {
  26.         url += '?' + sidebarBox.getAttribute("btSidebarParams");
  27.       }
  28.       var width = btBoomBundle.getString(sidebarid + ".width");
  29.  
  30.       if ((!window.top.document.getElementById("sidebar-box").width) ||
  31.           (window.top.document.getElementById("sidebar-box").width < width)) {
  32.         window.top.document.getElementById("sidebar-box").width = width;
  33.       }
  34.       if (url) {
  35.         document.getElementById("bt-sidebar-content").setAttribute("src", url);
  36.       }
  37.       window.top.document.getElementById("main-window").setAttribute("btSidebar", sidebarid);
  38.     }
  39.     function closeSidebar() {
  40.     }
  41. ]]>
  42.   </script>
  43.         <browser id="bt-sidebar-content" type="content"
  44.                  flex="1"/>
  45. </window>